#pragma once
#include <string>
#include <iostream>
#include <vector>
#include <list>
#include "gmshParser.h"
#include "tetgenParser.h"
#include "offParser.h"
#include "objParser.h"
#include "meshType.h"
#include "math.h"
#include "node.h"

namespace MeshUtils {

class YadosMesh
{
	private:
		MeshUtils::Vector3* vertices;
		MeshUtils::Vector3* verticesNormals;
		MeshUtils::Vector3* verticesTextures;
		MeshUtils::Face_t* faces;
		unsigned int nbFaces;
		unsigned int nbVertices;
		unsigned int nbVerticesNormals;
		unsigned int nbVerticesTextures;

	public:
		map<unsigned int, unsigned int> yadosToGraphic;
		void build(const std::string& filename, double scale = 1.0);
		void build(std::list<unsigned long long int> boundaryFaces, std::vector<Yados::Fem::Node*> nodesList, double scale);
		inline YadosMesh(void) : vertices(0), verticesNormals(0), faces(0), nbVerticesTextures(0) {};
		inline ~YadosMesh(void) {delete [] vertices; delete [] verticesNormals ; delete [] faces;};

		inline unsigned int  getNbVertices(void) const {return nbVertices;};
		inline Vector3* getVertices(void) const {return vertices;};

		inline unsigned int  getNbTextures(void) const {return nbVerticesTextures;};
		inline Vector3* getVerticesTextures(void) const {return verticesTextures;};

		inline unsigned int getNbVerticesNormals(void) const {return nbVerticesNormals;};
		inline Vector3* getVerticesNormals(void) const {return verticesNormals;};
		inline unsigned int getNbFaces(void) const {return nbFaces;};
		inline Face_t* getFaces(void) const {return faces;};
		inline map<unsigned int, unsigned int>& getYadosToGraphicMap(void) {return yadosToGraphic;};
};

} //namespace
